
var hqDetail = function(nian,yue){
    var urlz = "/integral/examJfpv/examPersonData?userId="+$("#userId").val()+"&nian="+nian+"&yue="+yue;
    $.ajax({
        url: urlz,
        type: "get",
        dataType: "json",
        success: function (res) {
            if(res.code != -200){
                $("#uname").text(res.data.dx.uname);
                $("#zw").text(res.data.dx.zw);
                $("#deptName").text(res.data.dx.deptName);
                $("#cjgzsj").text(res.data.dx.cjgzsj);
                $("#ljXxcs").text(res.data.dx.ljXxcs);
                $("#ljJfse").text(res.data.dx.ljJfse);
                $("#yxx").text("本年度已学习"+res.data.dx.xxts+"天");
                $("#pvg").text("本年度学习频率高"+res.data.dx.gts+"次");
                $("#pvz").text("本年度学习频率中"+res.data.dx.zts+"次");
                $("#pvd").text("本年度学习频率低"+res.data.dx.dts+"次");
            }
        }
    });
};


var hqDetailDate = function(){
    var urlz = "/integral/examJfpv/examTjDateData?userId="+$("#userId").val();
    $.ajax({
        url: urlz,
        type: "get",
        dataType: "json",
        success: function (res) {
            var arrObj = {};
            if(res.code != -200){
                $.each(res.data.dx,function (index,vale) {
                    arrObj[vale.ljTime] = "学习";
                });
            }
            console.log(arrObj);
            layui.use('laydate',function () {
                var laydate = layui.laydate;
                laydate.render({
                    elem: '#test-n1',
                    position: 'static',
                    btns: [],
                    change: function(value, date, endDate){
                    } ,
                    ready: function(date){
                        var nian = date.year;
                        var yue = date.month;
                        hqDetail(nian,yue);
                    },
                    mark: arrObj
                });
            });
        }
    });
};

$(function(){
    hqDetailDate();
});